{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=231
  Verdict: Accepted
}
{$APPTYPE CONSOLE}
{$R+,S+,Q+,I+,O-}
uses SysUtils;
var i,n,k,m:longint;  a:array[1..1001] of longint;
procedure qsort(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
  while a[i]<x do inc(i);
  while a[j]>x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(n);
fillchar(a,sizeof(a),0);
for i:=1 to n do read(a[i]);
read(k,m);
i:=0;
while i<n do begin
  inc(i);
  if i=m then begin
    write(k,' ',a[i],' ');
  end else write(a[i],' ');
end;
end.